"""
Development server entry point for Ruiyun Cloud Documentation Platform.

Run this script to start the Flask development server:
    python run.py

For production, use a WSGI server like Gunicorn:
    gunicorn -w 4 -b 0.0.0.0:8000 "app:create_app()"
"""
import os
from app import create_app

# Create Flask application
app = create_app()

if __name__ == '__main__':
    # Get configuration from environment
    host = os.getenv('FLASK_RUN_HOST', '0.0.0.0')
    port = int(os.getenv('FLASK_RUN_PORT', 5000))
    debug = os.getenv('FLASK_ENV', 'development') == 'development'

    print(f"Starting Ruiyun Cloud Documentation Platform")
    print(f"Environment: {app.config['FLASK_ENV']}")
    print(f"Debug mode: {debug}")
    print(f"Server: http://{host}:{port}")
    print()

    app.run(host=host, port=port, debug=debug)
